#!/bin/bash
# --2021.08.13
# --linjinting


isContains() {
    local array=$1
    local var=$2
    if [[ ${array[@]/${var}/} != ${array[@]} ]];then
        return 1
    else
        return 0
    fi
}
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
#if version_gt 6.5 7.0; then
#   echo "6.5 is greater than VERSION2"
#fi


#em1=("nihao", "wohao", "dajiahao", "hahahah")
#isContains $em1 "nihao"
#isContains $em1 "wobuhao"
